<div class="row-fluid">
	<div class="span6">
	<h3 class="heading"><?php echo __('Pagos del plan '); ?><?php echo h($planespago['Planespago']['nombre']) ?></h3>
	<?php if (!empty($planespago['Pago'])): ?>
	<table class="table table-striped table-bordered dTableR" id="dt_a">
    <thead>
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Nombre'); ?></th>
		<th><?php echo __('Monto'); ?></th>
		<th><?php echo __('Fecha de pago'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
    </thead>
    <tbody>
    
	<?php
		$i = 0;
		foreach ($planespago['Pago'] as $pago): ?>
		<tr>
			<td><?php echo $pago['id']; ?></td>
			<td><?php echo $pago['nombre']; ?></td>
			<td><?php echo $pago['monto']; ?></td>
			<td><?php echo $this->Utilidades->mostrarfecha($pago['fechapago']);?>&nbsp;</td>
			<td class="actions">
            <?php
                            echo $this->Ajax->link(
                                    $this->Html->image("iconos/edit.png"), 
                                    array(
                                        'controller' => 'pagos', 
                                        'action' => 'ajaxedit', $pago['id'], $id
                                    ), 
                                    array(
                                        'update' => 'pago',
                                        'title' => 'Edita el Plan de Pago',
                                        'escape' => false
                                   )
                            );
                            ?>
				
                <?php //echo $this->Html->link(__('Editar'), array('controller' => 'pagos', 'action' => 'edit', $pago['id'])); ?>
                
                <?php 
                                echo $this->Html->image("iconos/elim.png", array(
                                    "title" => "Elimina el Plan de Pago",
                                    'url' => array('controller'=>'pagos', 'action' => 'eliminar', $pago['id'], $id)
                                ));
                            ?>
				<?php //echo $this->Form->postLink(__('Eliminar'), array('controller' => 'pagos', 'action' => 'delete', $pago['id']), null, __('Are you sure you want to delete # %s?', $pago['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
    </tbody>
	</table>
    
<?php endif; ?>
<?php echo $this->Ajax->link(
                                'Registrar nuevo pago',
                                array( 'controller' => 'pagos', 'action' => 'anadir', $planespago['Planespago']['id']),
                                array( 'update' => 'pago', 'class'=>'btn btn-gebo')
                                );
                            ?>
</div>

<div class="span6">
  <div id="pago">
  </div>
</div>
</div>

<!-- sidebar -->
<?php echo $this->element('sidebar/planespa'); ?>
<!-- fin sidebar -->
<?php //llamamos scripts tablas ?>
<?php echo $this->element('jstablas'); ?>
<?php //llamamos scripts tablas ?>
<?php echo $this->element('jsformularios'); ?>
